package core;

import java.io.IOException;

/**
 * A generic Loader interface.  A Loader is responsible for loading the state of the Tracker
 * from a location.  Each loader chooses what locations it supports, but it must be able to
 * restore the state of the Tracker from the given location.
 * @author Royce
 *
 */
public interface ILoader {
	
	/**
	 * Loads model information from the default location
	 * @throws IOException if the loader cannot access or read the data at the given location.
	 * @throws IllegalArgumentException if the location argument is invalid in any way.
	 * @throws ClassNotFoundException if the location does not contain a Tracker.
	 * @return true if the operation succeeded.
	 * 
	 * @pre the default location exists.
	 * @post the loader's internal objects are populated
	 */
	public boolean load() throws IOException, ClassNotFoundException;
	
	/**
	 * Loads model information from the default location
	 * The meaning of the location can be different depending on the implementation.
	 * @throws IOException if the loader cannot access or read the data at the given location.
	 * @throws IllegalArgumentException if the location argument is invalid in any way.
	 * @throws ClassNotFoundException if the location does not contain a Tracker.
	 * @return true if the operation succeeded.
	 * 
	 * @pre location is a valid location according to the specific implementation
	 * @post the loader's internal objects are populated
	 */
	public boolean load(String fileName) throws IOException, ClassNotFoundException;
	
	/**
	 * Closes any streams contained by this ILoader
	 * @return true if the close operation succeeded, false otherwise.
	 * 
	 * @pre none.
	 * @post see return statement
	 */
	public boolean close();
}
